Add Model Router API documentation#1156
Conversation
| "policies": [ | ||
| { | ||
| "task_slug": "summarization", | ||
| "models": ["gemma3:latest", "gemma3:270m"], |
There was a problem hiding this comment.
seeing this error {"id":"invalid_argument","message":"rpc error: code = InvalidArgument desc = model gemma3:latest not found"}
There was a problem hiding this comment.
Changed to valid models: kimi-k2.5 openai-gpt5.4
| api_key_info: | ||
| $ref: '#/apiModelProviderKeyInfo' | ||
| type: object | ||
| apiCreateModelRouterInputPublic: |
There was a problem hiding this comment.
Entries are in alphabetical order, so apiGetModelRouter* must come before apiGetModelUsage*
| api_key_info: | ||
| $ref: '#/apiModelProviderKeyInfo' | ||
| type: object | ||
| apiDeleteModelRouterInputPublic: |
There was a problem hiding this comment.
this isn't referenced anywhere, can you please check if its required ?
| usage: | ||
| $ref: '#/apiResourceUsage' | ||
| type: object | ||
| apiGetModelRouterInputPublic: |
There was a problem hiding this comment.
this too is unreferenced, kindly check if its required
| type: string | ||
| fallback_models: | ||
| items: | ||
| type: object |
There was a problem hiding this comment.
should be type: string to match the create schema (apiCreateModelRouterInputPublic) ?
Also missing description and example
There was a problem hiding this comment.
Perfect, I have made that fix and changed type to string with a description/example
harshmaru7
left a comment
There was a problem hiding this comment.
Fix fallback_models type in apiUpdateModelRouterInputPublic (line 5686) — should be type: string, not type: object. Also missing description and example to match apiCreateModelRouterInputPublic.
harshmaru7
left a comment
There was a problem hiding this comment.
LGTM but can you confirm apiModelRouterSelectionPolicy.prefer as a free-form string instead of an enum ? since description mentions description: 'One of: none, cheapest, fastest'
| prefer: | ||
| description: 'One of: none, cheapest, fastest' | ||
| example: '"cheapest"' | ||
| type: string |
There was a problem hiding this comment.
i think you need to add enum here.
enum: [none, cheapest, fastest]
New public documentation for the model router api
https://do-internal.atlassian.net/browse/INF-244